import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/monitor/safety_alarm_statistic_entity.dart';

SafetyAlarmStatisticEntity $SafetyAlarmStatisticEntityFromJson(Map<String, dynamic> json) {
  final SafetyAlarmStatisticEntity safetyAlarmStatisticEntity = SafetyAlarmStatisticEntity();
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    safetyAlarmStatisticEntity.companyName = companyName;
  }
  final String? dates = jsonConvert.convert<String>(json['dates']);
  if (dates != null) {
    safetyAlarmStatisticEntity.dates = dates;
  }
  final int? num = jsonConvert.convert<int>(json['num']);
  if (num != null) {
    safetyAlarmStatisticEntity.num = num;
  }
  return safetyAlarmStatisticEntity;
}

Map<String, dynamic> $SafetyAlarmStatisticEntityToJson(SafetyAlarmStatisticEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyName'] = entity.companyName;
  data['dates'] = entity.dates;
  data['num'] = entity.num;
  return data;
}

extension SafetyAlarmStatisticEntityExtension on SafetyAlarmStatisticEntity {
  SafetyAlarmStatisticEntity copyWith({
    String? companyName,
    String? dates,
    int? num,
  }) {
    return SafetyAlarmStatisticEntity()
      ..companyName = companyName ?? this.companyName
      ..dates = dates ?? this.dates
      ..num = num ?? this.num;
  }
}